# 一维数组的初始化(创建)
# a = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]

a = [""] * 10
b = [0] * 10
# print(a,b)

c = [0 for i in range(10)]
d = [i for i in range(10)]
print(c,d)

# 变长数组 在很多其他语言中数组在初始化时长度是定死的!!!
# python中数组(列表)的设计是变长的! 是可以改变数组的长度的
e = [1]
e.append(2)
# print(e)

# 遍历完整的数组
list_01 = ["a","b","c","d","e"]
# for i in list_01:
#     print(i)

# 遍历数组的区间 使用下标!!!!!!!!!!
# 正常数组的区间: 0 到 len(数组)-1
# for i in range(0,len(list_01)):
#     if i >=1 and i <= 4:
#         print(list_01[i])

# 遍历数组的区间 使用切片!!!!!!!!!!
# for i in list_01[2:5]:
#     print(i)

# 反向遍历数组 使用下标!!!!!!!!!!
# print(list(range(10)))
# print(list(range(0,10)))
# for i in range(len(list_01)-1,-1,-1):
#     print(i,list_01[i])

# 反向遍历数组 使用切片!!!!!!!!!!
for i in list_01[::-1]:
    print(i)

